{extend name="top/index" /}
{block name="main"}
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
    <div class="page-content" style="min-height: 874px !important;">
        <!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
        <div class="modal fade" id="portlet-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                        <h4 class="modal-title">Modal title</h4>
                    </div>
                    <div class="modal-body">
                        Widget settings form goes here
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn blue">Save changes</button>
                        <button type="button" class="btn default" data-dismiss="modal">Close</button>
                    </div>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>
        <!-- /.modal -->
        <!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
        <!-- BEGIN STYLE CUSTOMIZER -->
        <div class="theme-panel hidden-xs hidden-sm">
            <!-- <div class="toggler">
            </div> -->
            <div class="toggler-close">
            </div>
            <div class="theme-options">
                <div class="theme-option theme-colors clearfix">
						<span>
							 THEME COLOR
						</span>
                    <ul>
                        <li class="color-black current color-default" data-style="default">
                        </li>
                        <li class="color-blue" data-style="blue">
                        </li>
                        <li class="color-brown" data-style="brown">
                        </li>
                        <li class="color-purple" data-style="purple">
                        </li>
                        <li class="color-grey" data-style="grey">
                        </li>
                        <li class="color-white color-light" data-style="light">
                        </li>
                    </ul>
                </div>
                <div class="theme-option">
						<span>
							 Layout
						</span>
                    <select class="layout-option form-control input-small">
                        <option value="fluid" selected="selected">Fluid</option>
                        <option value="boxed">Boxed</option>
                    </select>
                </div>
                <div class="theme-option">
						<span>
							 Header
						</span>
                    <select class="header-option form-control input-small">
                        <option value="fixed" selected="selected">Fixed</option>
                        <option value="default">Default</option>
                    </select>
                </div>
                <div class="theme-option">
						<span>
							 Sidebar
						</span>
                    <select class="sidebar-option form-control input-small">
                        <option value="fixed">Fixed</option>
                        <option value="default" selected="selected">Default</option>
                    </select>
                </div>
                <div class="theme-option">
						<span>
							 Sidebar Position
						</span>
                    <select class="sidebar-pos-option form-control input-small">
                        <option value="left" selected="selected">Left</option>
                        <option value="right">Right</option>
                    </select>
                </div>
                <div class="theme-option">
						<span>
							 Footer
						</span>
                    <select class="footer-option form-control input-small">
                        <option value="fixed">Fixed</option>
                        <option value="default" selected="selected">Default</option>
                    </select>
                </div>
            </div>
        </div>
        <!-- END STYLE CUSTOMIZER -->
        <!-- BEGIN PAGE HEADER-->
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                <h3 class="page-title">
                    借阅<small>整理现有文档，审批后存放到文件库</small>
                </h3>

                <!-- END PAGE TITLE & BREADCRUMB-->
            </div>
        </div>
        <form class="form-inline">
            <div class="form-group">
                <label class="sr-only" for="exampleInputEmail3"></label>
                <input type="text" class="form-control" id="search" placeholder="search">
            </div>
            <button type="submit" class="btn btn-success">搜索</button>
        </form>
        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row">
            <div class="col-md-12">
                <!-- Begin: life time stats -->
                <div class="portlet">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-gift"></i>阶段：
                        </div>
                        <a href="{:url('index/Borrows/index')}">全部（{$q_num}）</a>
                        <a href="{:url('index/Borrows/index',['type'=>1])}">申请（{$sq_num}）</a>
                        <a href="{:url('index/Borrows/index',['type'=>2])}">通过（{$sh_num}）</a>
                        <a href="{:url('index/Borrows/index',['type'=>3])}">拒绝（{$dh_num}）</a>

                        <div class="actions">
                            <div class="btn-group">
                                <a class="btn blue yellow-stripe getmodal" href="{:url('index/Borrows/addFile')}" data-toggle="dropdown">
                                    <i class="fa fa-plus"></i> 新建
                                </a>
                            </div>
                        </div>
                    </div>
                    <div class="portlet-body">
                        <div class="table-container">
                            <div class="table-actions-wrapper">
									<span>
									</span>
                                <select class="table-group-action-input form-control input-inline input-small input-sm">
                                    <option value="">Select...</option>
                                    <option value="publish">Publish</option>
                                    <option value="unpublished">Un-publish</option>
                                    <option value="delete">Delete</option>
                                </select>
                                <button class="btn btn-sm yellow table-group-action-submit"><i class="fa fa-check"></i> Submit</button>
                            </div>
                            <table class="table table-striped table-bordered table-hover" id="datatable_products">
                                <thead>
                                <tr role="row" class="heading">
                                    <th width="1%">
                                        <input type="checkbox" class="group-checkable">
                                    </th>
                                    <th width="2%">
                                        #
                                    </th>
                                    <th width="10%">
                                        文档
                                    </th>
                                    <th width="10%">
                                        借阅方式
                                    </th>
                                    <th width="10%">
                                        审核人
                                    </th>
                                    <th width="15%">
                                        创建人
                                    </th>
                                    <th width="15%">
                                        当前步骤
                                    </th>
                                    <th width="15%">
                                        上一步骤
                                    </th>
                                </tr>
                                {foreach name="in_data" item="nid"}
                                <tr role="row" class="filter">
                                    <td>
                                        <input type="checkbox" class="group-checkable">
                                    </td>
                                    <td>
                                        {$key+1}
                                    </td>
                                    <td>
                                        {if condition="$nid['cate_type'] eq 3"}
                                        <a  class="getmodal" data-id="{$nid.arc_id}" href="{:url('index/Compilation/onRead')}">
                                            {elseif condition="$nid['cate_type'] eq 2"/}
                                            <a  class="getmodal" data-id="{$nid.arc_id}" href="{:url('index/Arc/onRead')}">
                                                {else/}
                                                <a  class="getmodal" data-id="{$nid.arc_id}" href="{:url('index/Prearc/onRead')}">
                                                {/if}

                                                    {switch name="nid['arc_type']" }
                                                    {case value="docx"}<i class="fa fa-file-word-o" style="color: #5C6BC0;font-size: 1.33333333em;line-height: .75em"></i>{/case}
                                                    {case value="xlsx"}<i class="fa fa-file-excel-o" style="color: #43A047;font-size: 1.33333333em;line-height: .75em"></i>{/case}
                                                    {case value="txt"}<i class="fa fa-file-text-o" style="color: #BDBDBD;font-size: 1.33333333em;line-height: .75em"></i>{/case}
                                                    {case value="pptx"}<i class="fa fa-file-powerpoint-o" style="color: #FF6E40;font-size: 1.33333333em;line-height: .75em"></i>{/case}
                                                    {case value="html"}<i class="fa fa-file-code-o" style="color: #BDBDBD;font-size: 1.33333333em;line-height: .75em"></i>{/case}
                                                    {case value="doc"}<i class="fa fa-file-word-o" style="color: #5C6BC0;font-size: 1.33333333em;line-height: .75em"></i>{/case}
                                                    {case value="xls"}<i class="fa fa-file-excel-o" style="color: #43A047;font-size: 1.33333333em;line-height: .75em"></i>{/case}
                                                    {default /}<i class="fa fa-file-code-o" style="color: #BDBDBD;font-size: 1.33333333em;line-height: .75em"></i>
                                                    {/switch}

                                        {$nid.arc_name}.{$nid.arc_type}
                                                    {switch name="nid['audit_status']" }
                                                    {case value="0"}<span class="label label-sm label-info">初始</span>{/case}
                                                    {case value="1"}<span class="label label-sm label-primary " >待归档</span>{/case}
                                                    {case value="2"}<span  class="label label-sm label-success " >已归档</span>{/case}
                                                    {case value="3"}<span class="label label-sm label-danger "  >已打回</span>{/case}
                                                    {/switch}
                                            </a>
                                    </td>
                                    <td>
                                        {switch name="nid['bor_type']" }
                                        {case value="1"}<a  class="getmodal" data-id="{$nid.bor_id}" href="{:url('index/Borrows/showFile')}">在线查看</a>{/case}
                                        {case value="2"}<a  class="getmodal" data-id="{$nid.bor_id}" href="{:url('index/Borrows/showFile')}">有水印打印</a>{/case}
                                        {case value="3"}<a  class="getmodal" data-id="{$nid.bor_id}" href="{:url('index/Borrows/showFile')}">无水印打印</a>{/case}
                                        {case value="4"}<a  class="getmodal" data-id="{$nid.bor_id}" href="{:url('index/Borrows/showFile')}">下载PDF版</a>{/case}
                                        {case value="5"}<a  class="getmodal" data-id="{$nid.bor_id}" href="{:url('index/Borrows/showFile')}">下载原始文件</a>{/case}
                                        {case value="6"}<a  class="getmodal" data-id="{$nid.bor_id}" href="{:url('index/Borrows/showFile')}">查看原件</a>{/case}
                                        {case value="7"}<a  class="getmodal" data-id="{$nid.bor_id}" href="{:url('index/Borrows/showFile')}">借用复印件</a>{/case}
                                        {case value="8"}<a  class="getmodal" data-id="{$nid.bor_id}" href="{:url('index/Borrows/showFile')}">领用复印件</a>{/case}
                                        {case value="9"}<a  class="getmodal" data-id="{$nid.bor_id}" href="{:url('index/Borrows/showFile')}">借用原件</a>{/case}
                                        {/switch}
                                    </td>
                                    <td>
                                        {$_SESSION['think']['user_data'][$nid['update_user_id']]['user_name']}
                                    </td>
                                    <td>
                                        {$_SESSION['think']['user_data'][$nid['create_user_id']]['user_name']}
                                    </td>
                                    <td>
                                        <a class="getmodal" data-id="{$nid.bor_id}" href="{:url('index/Borrows/auditFile')}">
                                        {switch name="nid['bor_status']" }
                                        {case value="1"}申请中{/case}
                                        {case value="2"}审核通过{/case}
                                        {case value="3"}打回{/case}
                                        {/switch}
                                        </a>
                                    </td>
                                    <td>
                                        {switch name="nid['bor_status']" }
                                        {case value="1"}提交审核{/case}
                                        {case value="2"}审核通过{/case}
                                        {case value="3"}打回{/case}
                                        {/switch}
                                    </td>
                                </tr>
                                {/foreach}
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <!-- End: life time stats -->
            </div>
        </div>

        <!-- END PAGE CONTENT-->
    </div>
</div>
<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<div class="footer">
    <div class="footer-inner">
        2018 &copy; 仁聚科技
    </div>
    <div class="footer-tools">
		<span class="go-top">
			<i class="fa fa-angle-up"></i>
		</span>
    </div>
</div>
<script src="/static/assets/plugins/jstree/dist/jstree.min.js"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script src="/static/assets/scripts/custom/ui-tree.js"></script>
<script src="/static/assets/scripts/core/app.js"></script>
<link rel="stylesheet" type="text/css" href="/static/assets/plugins/jstree/dist/themes/default/style.min.css"/>
<script src="/static/assets/scripts/core/dt.js"></script>
</body>
<script>
    dt().getModals();
    $('.path').click(function () {
        var id = $(this).attr('data-id');
        $.ajax({
            url:'{:url(\'index/Borrows/setCateId\')}',
            data:{cate_id:id},
            type:'post',
            dataType:'json',
            success:function (e) {
                window.location.href = '{:url(\'index/Borrows/index\')}';
            }
        });
    });
</script>
<script>
        $(function(){
            $('.borrow').addClass("active");
        });
</script>
</html>
{/block}
